import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    component: () => import('../views/ParentPage.vue'),
  },
  {
    path: '/home/:id',
    name: 'home',
    component: () => import('../views/HomePage.vue'),
    children: [
      {
        path: '/child',
        component: () => import('../views/ChildPage.vue'),
      },
    ],
  },
  {
    path: '/exercise1',
    component: () => import('../views/Exercise1.vue'),
  },
  {
    path: '/exercise2',
    component: () => import('../views/Exercise2.vue'),
  },
  {
    path: '/exercise3',
    component: () => import('../views/Exercise3.vue'),
  },
  {
    path: '/exercise4',
    component: () => import('../views/Exercise4.vue'),
  },
  {
    path: '/exercise5',
    component: () => import('../views/Exercise5.vue'),
  },
  {
    path: '/exercise6',
    component: () => import('../views/Exercise6.vue'),
  },
  {
    path: '/exercise7',
    component: () => import('../views/Exercise7_Sort.vue'),
  },
  {
    path: '/exercise8',
    component: () => import('../views/Exercise8.vue'),
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes,
})

export default router
